resource "aws_db_subnet_group" "main" {
  name       = "main"
  subnet_ids = var.rds_subnet_ids
}

resource "aws_db_instance" "main" {
  allocated_storage      = 20
  availability_zone      = "eu-west-2a"
  engine                 = "postgres"
  engine_version         = "12.7"
  instance_class         = "db.t2.micro"
  name                   = "main"
  username               = "postgres"
  password               = "ThisIsATempPassword" # I'll be setting this to something different manually.
  multi_az               = false
  db_subnet_group_name   = aws_db_subnet_group.main.id
  vpc_security_group_ids = [var.rds_security_group_id]
}